package com.climb.ssm.service.impl;

import com.climb.ssm.dao.AccountDao;
import com.climb.ssm.service.AccountService;
import com.climb.ssm.util.BeanFactory;


/**
 * @author Administrator
 */
public class AccountServiceImpl implements AccountService {
//	AccountDao accountDao=new AccountDaoImpl();
    AccountDao accountDao=null;
	public AccountServiceImpl(){
		System.out.println("对象创建了");
	}

	public AccountServiceImpl(int i) {
	}

	@Override
	public void saveAccount(){
		/*如果account在方法外注入就无法被赋值,saveAccount的调用要早于它在外面被赋值*/
		accountDao = (AccountDao) BeanFactory.getBean("accountDao");
		accountDao.saveAccount();
	}
}